<?php

namespace App\controllers;

use App\BaseController;
use System\Core\File;
use System\Core\Request;

class UploadController extends BaseController
{
    public function image()
    {
        $request = new Request();
        $file = $request->file('file');
        try {
            $image = new File($file);
            $url = $image->move();
            $this->success('上传成功', $url);
        } catch (\Exception $e) {
            die($e->getMessage());
        }
    }
}
